package com.xinyi.reactivemvvmkt.base.activity

import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.xinyi.basic.base.activity.BaseActivity

/**
 * @author 杨耿雷
 * @date 2024/9/25 10:19
 * @description view的视图绑定基类
 */
abstract class BaseViewBindingActivity<VDB : ViewDataBinding> : BaseActivity() {

    private lateinit var _binding: VDB

    /**
     * 获取ViewBinding对象
     */
    val binding: VDB get() = _binding

    override fun setContentView() {
        _binding = DataBindingUtil.setContentView(this, initLayoutId())
        initObserveUI()
    }

    /**
     * 初始化UI观察
     */
    open fun initObserveUI() { }
}